package core.models;
import java.io.FileNotFoundException;
import java.io.ObjectInputStream;
import java.io.FileInputStream;
import java.io.IOException;
import java.lang.ClassNotFoundException;
import core.Runner;

public class Load {
	

	public static Runner load() throws IOException
	{
		String load = "savefile.dat";
		FileInputStream fileIn;
		ObjectInputStream objIn = null;
		Runner run = null;
		try
		{
			fileIn = new FileInputStream(load);
			objIn = new ObjectInputStream(fileIn);
			run = (Runner)objIn.readObject();
		}
		catch(FileNotFoundException e)
		{
			e.printStackTrace();
		}
		catch(ClassNotFoundException f)
		{
			f.printStackTrace();
		}
		catch(IOException io)
		{
			io.printStackTrace();
		}
		finally
		{
			objIn.close();
		}
		return run;
	}
}
